package com.fs.wechat.service;

import com.alibaba.fastjson.JSONObject;
import com.fs.common.pojo.Order;
import com.github.binarywang.wxpay.bean.notify.WxPayOrderNotifyResult;
import com.github.binarywang.wxpay.bean.result.WxPayOrderQueryResult;
import com.github.binarywang.wxpay.exception.WxPayException;

/**
 * @author DeveloperKK
 * @desc 微信支付接口
 * @creationTime 2019-08-20 14:44
 * @projectName yuezi-menu
 * @packageName com.fs.console.wechat.service
 */
public interface WechatPayService {

    /**
     * 登录凭证校验
     * @param code
     * @return
     */
    JSONObject code2Session(String code);

    /**
     * 统一下单
     * @return
     */
    <T> T createOrder(Order order) throws WxPayException;

    /**
     * 微信支付结果通知回调
     * @param xml
     * @return
     * @throws WxPayException
     */
    WxPayOrderNotifyResult wxPayOrderNotifyResult(String xml) throws WxPayException;

    /**
     * 查询订单状态接口
     * @param transactionId
     * @param outTradeNo
     * @return
     * @throws WxPayException
     */
    WxPayOrderQueryResult queryOrder(String transactionId, String outTradeNo) throws WxPayException;

}
